{extend name="wap/b2c/base" /} {block name="resources"}
<link rel="stylesheet" type="text/css"
	href="__TEMP__/{$style}/public/css/member_address.css">
<style>
body{
	background-color:#FFF;
}
.qrcode_bg img{
	margin-left:15px;
}
.shop-text{
	margin-left:15px;
	color:#333;
	font-size:15px;
}
.shop-text li{
	height:25px;
	line-height:25px;
}
.shop-align{
	display:inline-block;
	width:80px;
	
}
</style>	
{/block} {block name="goodsHead"}
<section class="head">
	<a class="head_back" onclick="window.history.go(-1)"
		href="javascript:void(0)"><i class="icon-back"></i></a>
	<div class="head-title">店铺二维码</div>
</section>
{/block} {block name="main"}
<img class="shop-qrcode" src="APP_MAIN/Member/showShopQecode?shop_id={$shop_id}" style="width:100%;margin-top:45px;"/>

{include file='wap/b2c/share'/}

{/block}
{block name="bottom"}{/block} 
 {block name="javascript"}
<script type="text/javascript">
$(function(){
	//$(".shop-qrcode").height($(window).height()-45);
	$.ajax({
		type:"post",
		data : {"shop_id" : "{$shop_id}" , "flag" : "qrcode_shop"},
		url : "APP_MAIN/member/getShareContents",
		success : function(data){
			/* alert($("#appId").val());
			alert($("#jsTimesTamp").val());
			alert($("#jsNonceStr").val());
			alert($("#jsSignature").val()); */
			//document.write(data.share_img);
				/* $("#share_title").val(data['share_title']);
				$("#share_desc").val(data['share_contents']);
				$("#share_url").val(data['share_url']);
				$("#share_img_url").val(data['share_img']);\ */
				wx.config({
				    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
				    appId: $("#appId").val(), // 必填，公众号的唯一标识
				    timestamp: $("#jsTimesTamp").val(), // 必填，生成签名的时间戳
				    nonceStr:  $("#jsNonceStr").val(), // 必填，生成签名的随机串
				    signature: $("#jsSignature").val(),// 必填，签名，见附录1
				    jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
				});
				wx.ready(function () {
				    var title = data['share_title'];
				    var share_contents = data['share_contents']+'\r\n';
				    var share_nick_name = data['share_nick_name']+'\r\n';
				    var desc2 = share_contents+ share_nick_name + "收藏热度：★★★★★";
				    var url = data['share_url'];
				    var img_url = data['share_img'];
				        wx.onMenuShareAppMessage({
				            title: title,
				            desc: desc2,
				            link: url,
				            imgUrl: img_url,
				            trigger: function (res) {
//				                alert('用户点击发送给朋友');
				            },
				            success: function (res) {
//				                alert('已分享');
				           
				            },
				            cancel: function (res) {
				                //alert('已取消');
				            },
				            fail: function (res) {
				                //alert(JSON.stringify(res));
				            }
				        });

				    // 2.2 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
				        wx.onMenuShareTimeline({
				            title: title,
				            link: url,
				            imgUrl: img_url,
				            trigger: function (res) {
				              // alert('用户点击分享到朋友圈');
				            },
				            success: function (res) {
				                //alert('已分享');
				            
				            },
				            cancel: function (res) {
				                //alert('已取消');
				            },
				            fail: function (res) {
				           //     alert(JSON.stringify(res));
				            }
				        });

				    // 2.3 监听“分享到QQ”按钮点击、自定义分享内容及分享结果接口
				        wx.onMenuShareQQ({
				            title: title,
				            desc: desc2,
				            link: url,
				            imgUrl: img_url,
				            trigger: function (res) {
				                //alert('用户点击分享到QQ');
				            },
				            complete: function (res) {
				                //alert(JSON.stringify(res));
				            },
				            success: function (res) {
				                //alert('已分享');
				            	
				            },
				            cancel: function (res) {
				                //alert('已取消');
				            },
				            fail: function (res) {
				                //alert(JSON.stringify(res));
				            }
				        });

				    // 2.4 监听“分享到微博”按钮点击、自定义分享内容及分享结果接口
				        wx.onMenuShareWeibo({
				            title: title,
				            desc: desc2,
				            link: url,
				            imgUrl: img_url,
				            trigger: function (res) {
				                //alert('用户点击分享到微博');
				            },
				            complete: function (res) {
				                //alert(JSON.stringify(res));
				            },
				            success: function (res) {
				                //alert('已分享');
				            
				            },
				            cancel: function (res) {
				                //alert('已取消');
				            },
				            fail: function (res) {
				                //alert(JSON.stringify(res));
				            }
				        });


				})
		
				}
			})
});
</script>
{/block}